package com.eke.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.eke.bean.Article;
import com.eke.bean.ArticleType;
import com.jason.dbhelper2.jdbc.BaseJdbcTemplate;

@Repository("articleTypeDao")
public class ArticleTypeDao extends BaseJdbcTemplate<ArticleType> {
	/**
	 * 通过文章类型父ID查询出文章类型
	 * 
	 * @param articleSubTypeId
	 *            文章类型父ID
	 * @return @{@link List}<{@link ArticleType}>
	 */
	public List<ArticleType> qurryArticleType(int articleSubTypeId) {
		String sql = "Select * from article_type where article_sub_type_id = ?";
		return this.queryForList(sql, articleSubTypeId);
	}

	/**
	 * 通过文章类型ID查询出文章类型
	 * 
	 * @param articleTypeId
	 *            文章类型ID
	 * @return @{@link List}<{@link ArticleType}>
	 */
	public List<ArticleType> qurryArticleTypeByParentId(int articleTypeId) {
		String sql = "Select * from article_type where article_type_id = ?";
		return this.queryForList(sql, articleTypeId);
	}

}
